import { Menu } from '@prisma/client';

// 菜单列表查询返回类型
export type MenuAndRolesType = ({
  roles: {
    role: {
      code: string;
    };
  }[];
} & Menu)[];

interface BaseMenu {
  id: number;
  parentId: number;
  name: string;
  path: string;
  component: string;
  perm: string;
  visible: number;
  sort: number;
  icon: string;
  redirect: string;
}

// 树形菜单类型
export interface MenuTreeItem extends BaseMenu {
  type: string;
  children: MenuTreeItem[];
}

// 菜单类型
export interface MenuItem extends BaseMenu {
  type: number;
}
